import config from "@/config"
import http from "@/utils/request"

export default {
    company: {
        selectCompanyList: {
            url: `${config.API_URL}/core/reportCoreService/create`,
            name: "查询列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        add: {
            url: `${config.API_URL}/main/hr/company/add`,
            name: "添加公司",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/hr/company/save`,
            name: "保存公司",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        },
        detail: {
            url: `${config.API_URL}/main/hr/company/detail`,
            name: "查看公司",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/hr/company/update`,
            name: "更新公司",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        }
    },
    //部门
    dept: {
        add: {
            url: `${config.API_URL}/main/hr/dept/add`,
            name: "添加",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/hr/dept/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/hr/dept/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/hr/dept/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        DeptTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "部门信息树状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },



    },
    //职位
    position: {
        detail: {
            url: `${config.API_URL}/main/hr/position/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/hr/position/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/hr/position/update`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },

        positionTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "部门信息树状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },



    },
    //人员
    employee: {
        detail: {
            url: `${config.API_URL}/main/hr/employee/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/hr/employee/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        },
        update: {
            url: `${config.API_URL}/main/hr/employee/update`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        },

        add: {
            url: `${config.API_URL}/main/hr/employee/add`,
            name: "添加",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        text: {
            url: `${config.API_URL}/hr/employee/testForm`,
            name: "添加",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
    },
    optRole: {
       add:{
            url: `${config.API_URL}/main/hr/optRole/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/hr/optRole/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/hr/optRole/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/hr/optRole/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        viewAssignerList: {
            url: `${config.API_URL}/main/hr/optRole/detailAssignerList`,
            name: "查看角色分配列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        updateAssignerList: {
            url: `${config.API_URL}/main/hr/optRole/updateAssignerList`,
            name: "修改角色分配列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        
    },
}